//
//  AVPlayCell.m
//  BeautyClother
//
//  Created by dllo on 15/9/29.
//  Copyright (c) 2015年 宋爽. All rights reserved.
//

#import "AVPlayCell.h"

@implementation AVPlayCell

- (void)awakeFromNib {
    // Initialization code
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.image = [[UIImageView alloc] init];
        [self.contentView addSubview:_image];
        [_image release];
        
        self.title = [[UILabel alloc] init];
        [self.contentView addSubview:_title];
        [_title release];
        
        self.video_time = [[UILabel alloc] init];
        [self.image addSubview:_video_time];
        [_video_time release];
        
        self.addtime = [[UIButton alloc] init];
        [self.contentView addSubview:_addtime];
        [_addtime release];
        
        self.tag_name = [[UILabel alloc] init];
        [self.contentView addSubview:_tag_name];
        [_tag_name release];
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    CGFloat offwidth = [UIScreen mainScreen].bounds.size.width / 375;
    CGFloat offheight = [UIScreen mainScreen].bounds.size.height / 667;
    
    self.image.frame = CGRectMake(5, 5, self.contentView.frame.size.width - 10, 200 * offheight);
    
    self.video_time.frame = CGRectMake(10, self.image.frame.size.height - 60, 60 * offwidth, 30 * offheight);
    self.video_time.backgroundColor = [UIColor blackColor];
    self.video_time.textColor = [UIColor whiteColor];
    self.video_time.textAlignment = NSTextAlignmentCenter;
    
    self.title.frame = CGRectMake(10, self.image.frame.size.height + self.image.frame.origin.y + 5, self.contentView.frame.size.width - 20, 60 * offheight);
    self.title.font = [UIFont boldSystemFontOfSize:18];
    
    self.addtime.frame = CGRectMake(5, self.title.frame.size.height + self.title.frame.origin.y + 5, 200 * offwidth, 40 * offheight);
    self.addtime.titleLabel.font = [UIFont systemFontOfSize:12];
    [self.addtime setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
    self.addtime.titleLabel.textAlignment = NSTextAlignmentCenter;
    
    self.tag_name.frame = CGRectMake(self.addtime.frame.origin.x + self.addtime.frame.size.width + 75 * offwidth, self.title.frame.size.height + self.title.frame.origin.y + 5, 60 * offwidth, 40 * offheight);
    self.tag_name.font = [UIFont systemFontOfSize:12];
    self.tag_name.tintColor = [UIColor lightGrayColor];
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
